package com.employee.controller;

import com.employee.pojo.dto.AuthorityDto;
import com.employee.pojo.result.Result;
import com.employee.service.AuthorityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @AUTHOR 尹书岿
 * @DATE 2025/1/13 17:28
 * @DESCRIBE
 */
@RestController
public class AuthorityController {
    @Autowired
    private AuthorityService authorityService;
    @GetMapping("/getAuthority")
    public Result<List<AuthorityDto>> getAuthority() {
        List<AuthorityDto> authority = authorityService.getAuthority();
        return Result.success(authority);
    }
    @GetMapping("/getAuthorityById/{id}")
    public Result<AuthorityDto> getAuthorityById(@PathVariable Integer id) {
        AuthorityDto authorityById = authorityService.getAuthorityById(id);
        return Result.success(authorityById);
    }
}
